#pragma once

namespace MkvMux
{

class MkvContext;

class MkvStream
{
    MkvStream(MkvStream&);
    MkvStream& operator=(const MkvStream&);
    
public:

    virtual ~MkvStream();

    virtual void WriteTrackEntry(int tn);

    virtual HRESULT Write(IMediaSample*) = 0;
    virtual int EndOfStream() = 0;
    virtual bool Wait() const = 0;
    
    void SetTrackNumber(int);
    int GetTrackNumber() const;
        
protected:

    MkvContext& m_context;
    int m_trackNumber;

    explicit MkvStream(MkvContext&);
    
    typedef __int64 TrackUID_t;    
    static TrackUID_t CreateTrackUID();    

    virtual void WriteTrackNumber(int);
    virtual void WriteTrackUID();
    virtual void WriteTrackType() = 0;
    virtual void WriteTrackName();
    virtual void WriteTrackCodecID() = 0;
    virtual void WriteTrackCodecPrivate();
    virtual void WriteTrackCodecName() = 0;
    virtual void WriteTrackSettings();
    
};


}  //end namespace MkvMux
